package org.jeecg.modules.LdProjectInfo.controller;

import java.io.OutputStream;
import java.lang.reflect.InvocationTargetException;
import java.net.URLEncoder;
import java.util.*;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.alibaba.fastjson.JSONObject;
import org.apache.batik.svggen.font.table.GsubTable;
import org.apache.poi.ss.usermodel.*;
import org.apache.poi.ss.util.CellRangeAddressList;
import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.system.util.JwtUtil;
import org.jeecg.common.system.vo.LoginUser;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.LdProjectInfo.entity.*;
import org.jeecg.modules.LdProjectInfo.service.ILdProjectInfoService;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;

import org.jeecg.modules.LdProjectInfoDetail.entity.LdProjectInfoDetail;
import org.jeecg.modules.LdProjectInfoDetail.service.ILdProjectInfoDetailService;
import org.jeecg.modules.deviceInfo.entity.DeviceInfo;
import org.jeecg.modules.deviceInfo.service.IDeviceInfoService;
import org.jeecg.modules.system.entity.SysDictItem;
import org.jeecg.modules.system.entity.SysUser;
import org.jeecg.modules.system.service.impl.SysBaseApiImpl;
import org.jeecg.modules.system.service.impl.SysDictItemServiceImpl;
import org.jeecg.modules.zcgl.entity.AssetFixed;
import org.jeecg.modules.zcgl.entity.AssetFixedPutImport;
import org.jeecgframework.poi.excel.ExcelExportUtil;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.entity.enmus.ExcelType;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;

 /**
 * @Description: 报价基本情况
 * @Author: jeecg-boot
 * @Date:   2025-05-06
 * @Version: V1.0
 */
@Api(tags="报价基本情况")
@RestController
@RequestMapping("/LdProjectInfo/ldProjectInfo")
@Slf4j
public class LdProjectInfoController extends JeecgController<LdProjectInfo, ILdProjectInfoService> {
	@Autowired
	private ILdProjectInfoService ldProjectInfoService;
	 @Autowired
	 private ILdProjectInfoDetailService ldProjectInfoDetailService;
	 @Autowired
	 private IDeviceInfoService deviceInfoService;
	 @Autowired
	 private SysBaseApiImpl sysBaseApi;


	 @Autowired
	 private  SysDictItemServiceImpl service;

	 @RequestMapping(value = "/getUserRole")
	 public Result<?> getUserRole(@RequestParam("username")String username ) {

		 return Result.ok( sysBaseApi.getRolesByUsername(username));
	 }
	 /**
	  * 通过excel导入数据
	  *
	  * @param request
	  * @param response
	  * @return
	  */
	 @RequestMapping(value = "/baozhuang/importExcel", method = RequestMethod.POST)
	 public Result<?> importExcelBz(HttpServletRequest request, HttpServletResponse response) {
		 return ldProjectInfoService.importExcelBz(request, response, BaoZhuang.class);
	 }

	 /**
	  * 通过excel导入数据
	  *
	  * @param request
	  * @param response
	  * @return
	  */
	 @RequestMapping(value = "/jgCost/importExcel", method = RequestMethod.POST)
	 public Result<?> importExcelAsset(HttpServletRequest request, HttpServletResponse response) {
		 return ldProjectInfoService.importExcel(request, response, JgCost.class);
	 }


	 @RequestMapping(value = "/gdlj/importExcel", method = RequestMethod.POST)
	 public Result<?> importExcelAssetgdlj(HttpServletRequest request, HttpServletResponse response) {
		 return ldProjectInfoService.importExcelgdlj(request, response, DgljCost.class);
	 }
	 /**
	  * 下载普通字段的Excel模板
	  */
	 @RequestMapping(value = "/downloadCommonTemplate")
	 public void downloadCommonTemplate(HttpServletRequest request, HttpServletResponse response) throws Exception {
		 // 创建空的导出列表（仅用于生成模板结构）
		 List<BaoZhuang> importList = new ArrayList<>();

		 // 获取当前登录用户信息
		 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();

		 // 设置导出参数，指定为XSSF格式（.xlsx）
		 ExportParams exportParams = new ExportParams(
				 "包装导入模板",
				 "导出人：" + (loginUser != null ? loginUser.getUsername() : "未知用户"),
				 "数据信息"
		 );
		 exportParams.setType(ExcelType.XSSF); // 强制使用xlsx格式，支持更多行列

		 // 创建工作簿和工作表
		 Workbook workbook = ExcelExportUtil.exportExcel(exportParams, BaoZhuang.class, importList);

		 // 设置响应头，指定文件格式和下载信息
		 response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
		 response.setCharacterEncoding("utf-8");
		 String fileName = URLEncoder.encode("包装导入模板.xlsx", "UTF-8");
		 response.setHeader("Content-disposition", "attachment;filename=" + fileName);

		 // 写入响应流
		 try (OutputStream outputStream = response.getOutputStream()) {
			 workbook.write(outputStream);
			 outputStream.flush();
		 } finally {
			 // 关闭工作簿释放资源
			 if (workbook != null) {
//				 workbook.close();
			 }
		 }
	 }



	 @RequestMapping(value = "/downloadDjljTemplate")
	 public void downloadDjljTemplate(HttpServletRequest request, HttpServletResponse response) throws Exception {
		 List<Djlj> importList = new ArrayList<>();
		 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();

		 // 获取工序下拉选项数据（超过300行）
		 List<String> gxs = service.listObjs(new QueryWrapper<SysDictItem>()
						 .eq("dict_id", "1920015088511148033")
						 .select("item_text"),
				 Object::toString
		 );

		 // 1. 关键修改：指定导出格式为XSSF（.xlsx），避免使用HSSF（.xls）
		 ExportParams exportParams = new ExportParams(
				 "刀夹具履历导入模板",
				 "导出人：" + loginUser.getUsername(),
				 "刀夹具履历"
		 );
		 exportParams.setType(ExcelType.XSSF); // 强制使用xlsx格式

		 // 创建工作簿（此时会生成XSSFWorkbook，支持超过256列）
		 Workbook workbook = ExcelExportUtil.exportExcel(exportParams, Djlj.class, importList);
		 Sheet mainSheet = workbook.getSheetAt(0);

		 // 以下代码不变（隐藏工作表、下拉选项设置等）
		 Sheet hiddenSheet = workbook.createSheet("HiddenOptions");
		 workbook.setSheetHidden(workbook.getSheetIndex(hiddenSheet), true);

		 int rowIndex = 0;
		 // 工序选项（A列）
		 for (String gx : gxs) {
			 Row row = hiddenSheet.getRow(rowIndex) != null ? hiddenSheet.getRow(rowIndex) : hiddenSheet.createRow(rowIndex);
			 Cell cell = row.createCell(0);
			 cell.setCellValue(gx);
			 rowIndex++;
		 }
		 Name gxName = workbook.createName();
		 gxName.setNameName("GxOptions");
		 gxName.setRefersToFormula("HiddenOptions!$A$1:$A$" + gxs.size());

		 // 种类选项（B列）
		 rowIndex = 0;
		 String[] typeOptions = {"刀具", "量具", "夹具", "其它"};
		 for (String type : typeOptions) {
			 Row row = hiddenSheet.getRow(rowIndex) != null ? hiddenSheet.getRow(rowIndex) : hiddenSheet.createRow(rowIndex);
			 Cell cell = row.createCell(1);
			 cell.setCellValue(type);
			 rowIndex++;
		 }
		 Name typeName = workbook.createName();
		 typeName.setNameName("TypeOptions");
		 typeName.setRefersToFormula("HiddenOptions!$B$1:$B$" + typeOptions.length);

		 // 投入说明选项（C列）
		 rowIndex = 0;
		 String[] trOptions = {"通用", "借用", "专用"};
		 for (String tr : trOptions) {
			 Row row = hiddenSheet.getRow(rowIndex) != null ? hiddenSheet.getRow(rowIndex) : hiddenSheet.createRow(rowIndex);
			 Cell cell = row.createCell(2);
			 cell.setCellValue(tr);
			 rowIndex++;
		 }
		 Name trName = workbook.createName();
		 trName.setNameName("TrOptions");
		 trName.setRefersToFormula("HiddenOptions!$C$1:$C$" + trOptions.length);

		 // 设置下拉验证（代码不变）
		 DataValidationHelper validationHelper = mainSheet.getDataValidationHelper();

		 // 工序名称列（索引0）
		 DataValidationConstraint gxConstraint = validationHelper.createFormulaListConstraint("GxOptions");
		 CellRangeAddressList gxAddressList = new CellRangeAddressList(1, 65535, 0, 0);
		 DataValidation gxValidation = validationHelper.createValidation(gxConstraint, gxAddressList);
		 gxValidation.setShowErrorBox(true);
		 mainSheet.addValidationData(gxValidation);

		 // 种类列（索引3）
		 DataValidationConstraint typeConstraint = validationHelper.createFormulaListConstraint("TypeOptions");
		 CellRangeAddressList typeAddressList = new CellRangeAddressList(1, 65535, 3, 3);
		 DataValidation typeValidation = validationHelper.createValidation(typeConstraint, typeAddressList);
		 typeValidation.setShowErrorBox(true);
		 mainSheet.addValidationData(typeValidation);

		 // 投入说明列（索引4）
		 DataValidationConstraint trConstraint = validationHelper.createFormulaListConstraint("TrOptions");
		 CellRangeAddressList trAddressList = new CellRangeAddressList(1, 65535, 4, 4);
		 DataValidation trValidation = validationHelper.createValidation(trConstraint, trAddressList);
		 trValidation.setShowErrorBox(true);
		 mainSheet.addValidationData(trValidation);

		 // 2. 关键修改：响应头明确指定xlsx格式
		 response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
		 response.setCharacterEncoding("utf-8");
		 String fileName = URLEncoder.encode("刀夹具履历导入模板.xlsx", "UTF-8");
		 response.setHeader("Content-disposition", "attachment;filename=" + fileName);

		 try (OutputStream outputStream = response.getOutputStream()) {
			 workbook.write(outputStream);
			 outputStream.flush();
		 }
	 }
	 /**
	  * 加工费明细导入模板下载
	  * 修复点：确保下拉数据正确写入、名称范围引用准确、列索引严格匹配
	  */
	 /**
	  * 加工费明细细导入模板下载
	  * 修复点：为设备和工序序分别创建独立的隐藏工作表，避免数据覆盖
	  */
	 @RequestMapping(value = "/download")
	 public void downloadUserTemplateAsset(HttpServletRequest request, AssetFixed assetFixed, HttpServletResponse response) throws InvocationTargetException, IllegalAccessException, IOException {
		 List<AssetFixedPutImport> importList = new ArrayList<>();
		 LoginUser loginUser = (LoginUser) SecurityUtils.getSubject().getPrincipal();

		 ExportParams exportParams = new ExportParams("加工费明细导入模板", "导出人：" + loginUser.getUsername(), "加工费导入模板");

		 // 扩展下拉列表功能
		 Workbook workbook = ExcelExportUtil.exportExcel(exportParams,
				 JgCost.class,
				 importList);

		 // ================== 设备下拉处理（保持现有逻辑不变）==================
		 // 模拟设备名称下拉选项数据
		 List<DeviceInfo> deviceOptions = deviceInfoService.list();
		 // 创建设备专用的隐藏工作表
		 Sheet deviceHiddenSheet = workbook.createSheet("DeviceHidden");
		 int deviceRowIndex = 0;
		 // 存储设备名称选项到第二列
		 for (DeviceInfo option : deviceOptions) {
			 Row row = deviceHiddenSheet.createRow(deviceRowIndex++);
			 Cell cell = row.createCell(1); // 第二列
			 cell.setCellValue(option.getDeviceNameModel());
		 }
		 // 定义设备名称的名称范围
		 Name deviceNamedRange = workbook.createName();
		 deviceNamedRange.setNameName("DeviceDropdownList");
		 deviceNamedRange.setRefersToFormula("DeviceHidden!$B$1:$B$" + deviceOptions.size());

		 // ================== 新增工序下拉处理（使用新的隐藏工作表）==================
		 // 获取并验证工序数据
		 List<String> processOptions = service.listObjs(
				 new QueryWrapper<SysDictItem>()
						 .eq("dict_id", "1920015088511148033")
						 .select("item_text"),
				 Object::toString
		 );

		 // 创建工序专用的隐藏工作表（新sheet，不会覆盖设备数据）
		 Sheet processHiddenSheet = workbook.createSheet("ProcessHidden");
		 int processRowIndex = 0;
		 // 存储工序数据到第一列
		 for (String process : processOptions) {
			 Row row = processHiddenSheet.createRow(processRowIndex++);
			 Cell cell = row.createCell(0); // 第一列
			 cell.setCellValue(process);
		 }

		 // 定义工序的名称范围（使用新的工作表名）
		 Name processNamedRange = workbook.createName();
		 processNamedRange.setNameName("ProcessDropdownList");
		 processNamedRange.setRefersToFormula("ProcessHidden!$A$1:$A$" + processOptions.size());

		 // ================== 下拉验证配置 ==================
		 // 获取第一个工作表
		 Sheet sheet = workbook.getSheetAt(0);
		 // 创建数据验证助手
		 DataValidationHelper validationHelper = sheet.getDataValidationHelper();

		 // 设备名称下拉列表验证（保持现有逻辑）
		 DataValidationConstraint deviceConstraint = validationHelper.createFormulaListConstraint("DeviceDropdownList");
		 CellRangeAddressList deviceAddressList = new CellRangeAddressList(1, 65535, 1, 1); // 第二列
		 DataValidation deviceValidation = validationHelper.createValidation(deviceConstraint, deviceAddressList);
		 deviceValidation.setSuppressDropDownArrow(false);
		 deviceValidation.setShowErrorBox(true);
		 sheet.addValidationData(deviceValidation);

		 // 新增工序下拉列表验证
		 DataValidationConstraint processConstraint = validationHelper.createFormulaListConstraint("ProcessDropdownList");
		 CellRangeAddressList processAddressList = new CellRangeAddressList(1, 65535, 0, 0); // 第一列
		 DataValidation processValidation = validationHelper.createValidation(processConstraint, processAddressList);
		 processValidation.setSuppressDropDownArrow(false);
		 processValidation.setShowErrorBox(true);
		 sheet.addValidationData(processValidation);

		 // 打印日志，方便调试
		 System.out.println("DeviceDropdownList 引用范围: " + workbook.getName("DeviceDropdownList").getRefersToFormula());
		 System.out.println("ProcessDropdownList 引用范围: " + workbook.getName("ProcessDropdownList").getRefersToFormula());

		 // 隐藏工作表
		 workbook.setSheetHidden(workbook.getSheetIndex(deviceHiddenSheet), true);
		 workbook.setSheetHidden(workbook.getSheetIndex(processHiddenSheet), true);

		 // 设置响应头
		 response.setContentType("application/vnd.openxmlformats-officedocument.spreadsheetml.sheet");
		 response.setCharacterEncoding("utf-8");
		 String fileName = URLEncoder.encode("加工费明细导入模板.xlsx", "UTF-8");
		 response.setHeader("Content-disposition", "attachment;filename=" + fileName);

		 // 写入输出流
		 OutputStream outputStream = response.getOutputStream();
		 workbook.write(outputStream);
		 outputStream.flush();
		 outputStream.close();
	 }



	 /**
	 * 分页列表查询
	 *
	 * @param ldProjectInfo
	 * @param pageNo
	 * @param pageSize
	 * @param req
	 * @return
	 */
	@AutoLog(value = "报价基本情况-分页列表查询")
	@ApiOperation(value="报价基本情况-分页列表查询", notes="报价基本情况-分页列表查询")
	@GetMapping(value = "/list")
	public Result<?> queryPageList(LdProjectInfo ldProjectInfo,
								   @RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
								   @RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
								   HttpServletRequest req) {
		QueryWrapper<LdProjectInfo> queryWrapper = QueryGenerator.initQueryWrapper(ldProjectInfo, req.getParameterMap());
		queryWrapper.orderByDesc("create_time");
		Page<LdProjectInfo> page = new Page<LdProjectInfo>(pageNo, pageSize);
		queryWrapper
				.isNull("f_id")  // 条件1：f_id 为 null
				.or()            // 或者
				.eq("f_id", ""); // 条件2：f_id 为空字符串
		IPage<LdProjectInfo> pageList = ldProjectInfoService.page(page, queryWrapper);
		return Result.ok(pageList);
	}

	 /**
	  *获取所有主表，用来选择历史的报价数据
	  *
	  * @return
	  */
	 @GetMapping(value = "/getAllList")
	 public Result<?> findSon() {
		 List<LdProjectInfo>  list = ldProjectInfoService.list(new QueryWrapper<LdProjectInfo>().isNull("f_id"));
		 return Result.ok(list);
	 }




	 /**
	  *查询当前项目下的零件
	  *
	  * @return
	  */
	 @GetMapping(value = "/findSon")
	 public Result<?> findSon(@RequestParam(value = "id")String id) {


	 	List<LdProjectInfoDetail>  list = ldProjectInfoDetailService.list(new QueryWrapper<LdProjectInfoDetail>().eq("main_id",id));

		 for (int i = 0; i < list.size(); i++) {
			 LdProjectInfoDetail ldProjectInfoDetail = list.get(i);
			 JSONObject jsonObject = JSON.parseObject(ldProjectInfoDetail.getContent());
			 String projectName = jsonObject.get("partName").toString();
			 ldProjectInfoDetail.setProjectName(projectName);
		 }

		 return Result.ok(list);
	 }



	 /**
	  * 分页列表查询 历史记录
	  *
	  * @param ldProjectInfo
	  * @param pageNo
	  * @param pageSize
	  * @param req
	  * @return
	  */
	 @AutoLog(value = "报价基本情况-分页列表查询历史记录")
	 @ApiOperation(value="报价基本情况-分页列表查询历史记录", notes="报价基本情况-分页列表查询历史记录")
	 @GetMapping(value = "/listHis")
	 public Result<?> queryPageListHis(LdProjectInfo ldProjectInfo,
									@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
									@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
									HttpServletRequest req) {
		 QueryWrapper<LdProjectInfo> queryWrapper = QueryGenerator.initQueryWrapper(ldProjectInfo, req.getParameterMap());
		 Page<LdProjectInfo> page = new Page<LdProjectInfo>(pageNo, pageSize);
		 queryWrapper.isNotNull("f_id");
		 IPage<LdProjectInfo> pageList = ldProjectInfoService.page(page, queryWrapper);
		 return Result.ok(pageList);
	 }

	 /**
	  *   存档
	  *
	  * @param
	  * @return
	  */
	 @AutoLog(value = "零件报价绑定关系-存档")
	 @ApiOperation(value="零件报价绑定关系-存档", notes="零件报价绑定关系-存档")
	 @PostMapping(value = "/addVersion")
	 public Result<?> addVersion(@RequestBody LdProjectInfo ldProjectInfo) {
		 ldProjectInfo.setFId(ldProjectInfo.getId());

		 // 获取登录用户信息
		 LoginUser sysUser = JwtUtil.getLoginUser();
		 ldProjectInfo.setShenpiren(sysUser.getUsername());
		 ldProjectInfo.setShenpirenName(sysUser.getRealname());
		 ldProjectInfo.setId("");
		 ldProjectInfo.setCreateTime(new Date());
		 ldProjectInfoService.save(ldProjectInfo);
		 List<LdProjectInfoDetail> ldProjectInfoDetail = ldProjectInfoDetailService.list(new QueryWrapper<LdProjectInfoDetail>().eq("main_id",ldProjectInfo.getFId()));
		 for (int i = 0; i < ldProjectInfoDetail.size(); i++) {
			 LdProjectInfoDetail ldProjectInfoDetail1 = ldProjectInfoDetail.get(i);
			 ldProjectInfoDetail1.setId(null);
			 ldProjectInfoDetail1.setMainId(ldProjectInfo.getId());
			 ldProjectInfoDetailService.save(ldProjectInfoDetail1);
		 }
		 return Result.ok("存档！");
	 }


	 /**
	 *   添加
	 *
	 * @param ldProjectInfo
	 * @return
	 */
	@AutoLog(value = "报价基本情况-添加")
	@ApiOperation(value="报价基本情况-添加", notes="报价基本情况-添加")
	@PostMapping(value = "/add")
	public Result<?> add(@RequestBody LdProjectInfo ldProjectInfo) {
		ldProjectInfoService.save(ldProjectInfo);
		return Result.ok("添加成功！");
	}

	/**
	 *  编辑
	 *
	 * @param ldProjectInfo
	 * @return
	 */
	@AutoLog(value = "报价基本情况-编辑")
	@ApiOperation(value="报价基本情况-编辑", notes="报价基本情况-编辑")
	@PutMapping(value = "/edit")
	public Result<?> edit(@RequestBody LdProjectInfo ldProjectInfo) {
		ldProjectInfoService.updateById(ldProjectInfo);
		return Result.ok("编辑成功!");
	}

	/**
	 *   通过id删除
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "报价基本情况-通过id删除")
	@ApiOperation(value="报价基本情况-通过id删除", notes="报价基本情况-通过id删除")
	@DeleteMapping(value = "/delete")
	public Result<?> delete(@RequestParam(name="id",required=true) String id) {
		ldProjectInfoService.removeById(id);
		return Result.ok("删除成功!");
	}

	/**
	 *  批量删除
	 *
	 * @param ids
	 * @return
	 */
	@AutoLog(value = "报价基本情况-批量删除")
	@ApiOperation(value="报价基本情况-批量删除", notes="报价基本情况-批量删除")
	@DeleteMapping(value = "/deleteBatch")
	public Result<?> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
		this.ldProjectInfoService.removeByIds(Arrays.asList(ids.split(",")));
		return Result.ok("批量删除成功!");
	}

	/**
	 * 通过id查询
	 *
	 * @param id
	 * @return
	 */
	@AutoLog(value = "报价基本情况-通过id查询")
	@ApiOperation(value="报价基本情况-通过id查询", notes="报价基本情况-通过id查询")
	@GetMapping(value = "/queryById")
	public Result<?> queryById(@RequestParam(name="id",required=true) String id) {
		LdProjectInfo ldProjectInfo = ldProjectInfoService.getById(id);
		if(ldProjectInfo==null) {
			return Result.error("未找到对应数据");
		}
		return Result.ok(ldProjectInfo);
	}

    /**
    * 导出excel
    *
    * @param request
    * @param ldProjectInfo
    */
    @RequestMapping(value = "/exportXls")
    public ModelAndView exportXls(HttpServletRequest request, LdProjectInfo ldProjectInfo) {
        return super.exportXls(request, ldProjectInfo, LdProjectInfo.class, "报价基本情况");
    }

    /**
      * 通过excel导入数据
    *
    * @param request
    * @param response
    * @return
    */
    @RequestMapping(value = "/importExcel", method = RequestMethod.POST)
    public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
        return super.importExcel(request, response, LdProjectInfo.class);
    }

}
